The invention relates to the field of client-side execution of Web applications. In particular, the invention relates to runtime code replacement at client-side Web applications.
A common debugging technique used with the Java® language is Hot Code Replace (HCR). HCR allows a debugger to transmit new code to a Java Virtual Machine (VM), allowing modification of the code in a running application. Restarting the application is not required and therefore this approach enables problems to be fixed quickly. (Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle Corporation and/or its affiliates in the United States, other countries, or both.)
A Java VM allows a debugger to connect directly (to a known port over transmission control protocol (TCP)) to the integrated development environment (IDE) and interact using a known application programming interface (API). The direct relationship between the Java IDE and the VM (and an associated API) allows the IDE to directly control the VM resources and hence directly replace applicable bits of code.
HCR in Java works well because the language is strongly typed, and so it is possible from within the VM to identify all objects in memory of a certain type, and hence which need to have their functionality replaced.
In Web applications, the model is usually different, in that the application running in the client browser receives each script using a one-time HTTP (Hypertext Transfer Protocol) request to the Web server, which loads the script from disk.
As Web applications become more complex, more code is executed on the client (e.g., the browser application at the client). Reloading such an application after every minor client-side code change can be tedious.